#!/bin/sh
#defined
echo "start!"
ID=`ps -aux |grep java|grep "server1"| awk '{print $2}'`
echo $ID
kill -9 $ID
echo "server1 pid:$ID has killed!"
ID=`ps -aux |grep java|grep "server2"| awk '{print $2}'`
echo $ID
kill -9 $ID
echo "server2 pid:$ID has killed!"
ID=`ps -aux |grep java|grep "server3"| awk '{print $2}'`
echo $ID
kill -9 $ID
echo "server3 pid:$ID has killed!"
ID=`ps -aux |grep java|grep "server4"| awk '{print $2}'`
echo $ID
kill -9 $ID
echo "server4 pid:$ID has killed!"
echo "start to server1!"
nohup java -jar -Dspring.config.location=/mydata/apps/config/application_server1.properties /mydata/apps/dubbo.server1.impl-0.0.1-SNAPSHOT.jar -dserver1 &
echo "start to server2!"
nohup java -jar /mydata/apps/dubbo.server3.impl-0.0.1-SNAPSHOT.jar -dserver3 &
echo "start to server3!"
nohup java -jar -Dspring.config.location=/mydata/apps/config/application_server2.properties /mydata/apps/dubbo.server2.impl-0.0.1-SNAPSHOT.jar -dserver2 &
echo "start to server4!"
nohup java -jar -Dspring.config.location=/mydata/apps/config/application_server4.properties /mydata/apps/dubbo.server4.impl-0.0.1-SNAPSHOT.jar -dserver4 &
echo "end!"